import { defineStore } from "pinia";
import { ref } from "vue";

// useStore 可以是 useUser、useCart 之类的任何东西
// 第一个参数是应用程序中 store 的唯一 id
export const useUserStore = defineStore("user",()=> {
  // other options...
    // 菜单列表
    const menuList=ref( [
      {
        name: "index",
        path: "/index",
        component: () => import("../pages/layouts/UserLayout.vue"),
        redirect: "/lightManage",
        children: [
          {
            name: "somo",
            path: "/somo",
            redirect: "/lightManage",
            children: [
              {
                name: "lightManage",
                path: "/lightManage",
                component: () => import("../pages/LightManage.vue"),
              },
              {
                name: "commentManage",
                path: "/commentManage",
                component: () => import("../pages/commentManage/index.vue"),
              },
            ],
          },
          {
            name: "vehicleManage",
            path: "/vehicleManage",
            redirect: "/carStatus",
            children: [
              {
                name: "carStatus",
                path: "/carStatus",
                component: () => import("../pages/CarStatus.vue"),
              },
              {
                name: "carInfo",
                path: "/carInfo",
                component: () => import("../pages/CarInfo.vue"),
              },
              {
                name: "checkManage",
                path: "/checkManage",
                component: () => import("../pages/CheckManage.vue"),
              },
            ],
          },
          {
            name: "system",
            path: "/system",
            redirect: "/userManage",
            children: [
              {
                name: "userManage",
                path: "/userManage",
                component: () => import("../pages/system/userManage/index.vue"),
              },
              {
                name: "roleManage",
                path: "/roleManage",
                component: () => import("../pages/system/roleManage/index.vue"),
              },
            ],
          },
        ],
      },
    ])
    const selectMenu=(val)=>{
      // 判断
    }


    return { menuList };
});
